package com.chenju.easyshotjava.core;

import java.util.List;

public class ListUtils {

    public static String toString(List<String> list) {
        if (list.isEmpty()) {
            return "";
        }
        StringBuilder sb = new StringBuilder();
        int minSize = Math.min(list.size(), 5);
        for (int i = 0; i <= minSize; i++) {
            sb.append(list.get(i));
            sb.append("\n");
        }
        if (list.size() > 5) {
            sb.append("……");
            sb.append("\n");
        }
        return sb.toString();
    }

}
